var preDate = new Date("2023/4/21 21:58:10"); //指定时间
function djs(d) {
  var nowDate = new Date();
  //时间差值
  var ss = Math.floor((d - nowDate) / 1000);
  //时分秒
  //？这么多秒是由多少小时，多少分，多少秒组成
  var h = Math.floor(ss / 3600);
  var m = Math.floor((ss % 3600) / 60);
  var s = Math.floor(ss % 60);
  box.innerText = h + ":" + m + ":" + s;

  if (ss <= 0) {
    clearInterval(timer);
    box.innerText = "秒杀结束";
  }
}
djs(preDate);
var timer = setInterval(function () {
  djs(preDate);
}, 1000);
